package com.uchiha.nova.mainService.service.impl;

import com.uchiha.nova.core.tool.util.SpringUtil;
import com.uchiha.nova.mainService.service.OauthTokenService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Author 周林静
 * @Date 2025-03-25 8:26
 * @Version 1.0
 */
@Service
public class FactoryForOauthToken {

    public OauthTokenService getService(String grantType) {
        OauthTokenService oauthTokenService = SpringUtil.getBean(grantType, OauthTokenService.class);
        if(oauthTokenService == null) {
            throw new RuntimeException("no oauthTokenService defined");
        }
        return oauthTokenService;
    }
}
